package com.example.demo.Dao;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @Author : 叶荻风
 * @create : 2024/5/21 20:05
 * invoke方法的作用
 * 额外功能写在invoke
 * 额外功能 -> 原始方法 之前之后 前后
 */
public class Around implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("extra log before");
        //前后加额外功能
        Object proceed = invocation.proceed();
        System.out.println("extra log after");
        return proceed;
    }
}
